home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / sticpsrc.lzh / DOC / SCC.ARC / SCC.DOC next >
Text File  |  1990-03-02  |  19KB  |  443 lines

  1. 06601030305800
  2. F0110030
  3. 9[...................................................]001
  4. êTheZ8530SCCdriverfortheAtariSTandPCClonesÇ
  5.  
  6. ByR.E.Janssen,PE1CHL.
  7.  
  8.  
  9. AdriverhasbeenwrittentosupportanumberofZ8530SCCchips
  10. connectedtoanAtariSTcomputer.Thedriverisconfigurable
  11. fordifferenthardwareconfigurations,andanexampleschematic
  12. supportingupto7SCC's(14channels)hasbeenincluded.
  13. ThedrivernowalsorunsonPCClones,althoughtheinterrupt
  14. handlingcapabilitiesofthistypeofcomputerlimitsthemaximum
  15. speedandnumberofchannelstoalowervaluethanontheAtari.
  16. (dependingonthespeedofyourmachine)
  17.  
  18. Eachchannelmaybeindepentlyprogrammedtosupport:
  19.  
  20. -AnasynchronousSLIPline
  21. -AnasynchronousinterfacetoaKISSTNC
  22. -DirectAX.25(HDLC)
  23.  
  24. Thesoftwarehasbeenwritteninsuchawaythataportto
  25. anotherenvironmentwhereZ8530SCC'sareavailableshouldbe
  26. relativelystraightforward.Addressesofthechipsare
  27. completelyconfigurable,andmostprobablyonlythefirst-level
  28. interrupthandler(writteninassemblylanguage)hastobe
  29. adaptedtothespecificconfigurationoftheinterrupt
  30. acknowledgelogicinthesystem.
  31. ThePCversionsupportsafewspecialtypesofinterfaceboard,
  32. thatusespecificIOportstocontrolcertainon-boardfeatures
  33. likeMODEMsandinterruptconfiguration.
  34.  
  35. êInitializationandattachmentofthechannelsÇ
  36.  
  37. Tousethedriver,2stepsmustbeperformed:
  38.  
  39. 1.Globalinitializationofthedriver
  40. 2.Attachmentofeachchannel,specifyingmodeandoptions
  41.  
  42. TheglobalinitializationisneededtoresetallSCCsandto
  43. installacommoninterrupthandler.Also,thehardwareaddresses
  44. ofthechipsaredefinedinthisstep.Inthesecondstep,each
  45. channelissetupfortheintendeduse.
  46.  
  47.  
  48. ♪≡ê1.InitializationÇ
  49.  
  50. Initializationisperformedusingthe"attachsccinit"command,
  51. usingthefollowingsyntax:
  52.  
  53. attachscc<numberofchips>init<baseaddress>
  54. <spacingbetweenchips><offsettochannelActrl>
  55. <offsettochannelBctrl><offsetfromctrltodata>
  56. <addressofINTACKlatch>|0<interruptnumber>
  57. p<PCLKfrequency>|r<RTxCfrequency>
  58. [<specialinterfacetype><interfaceparameter>]
  59.  
  60. Toinitializeaboardwith2SCCsusingmyschematic,the
  61. followingcommandwouldbeused:
  62.  
  63. attach scc 2 init fffd00 8 3 7 -2 fffd3f 3 p4915200
  64.  
  65. Thisspecifiesinterruptnumber3,anormallyunusedinterruptin
  66. 520STand1040STmachines.InthenewerMega-STthisinterrupt
  67. isusedfortheBlitter.Inthiscase,itispossibletousethe
  68. "ringindicator"inputoftheRS232interfaceasaninterrupt
  69. source.Ithasinterruptnumber14.
  70.  
  71. TheINTACKlatch(write,thenreadtogettheinterruptvector)
  72. islocatedat0xfffd3f.Itisalsopossibletospecify0for
  73. thisaddress.Inthatcase,INTACKisnotusedandthedriver
  74. findstheinterruptingchipbypollingeachRR3Aregister.This
  75. allowsamoresimplehardwaredesign,especiallyforPCs.
  76.  
  77. Thecrystalclockisspecifiedas4.9152MHz.Otherfrequencies
  78. canbeused,andthisparametershouldbeadjustedaccordingly.
  79. TheclockusedforbaudrategenerationisconnectedtoPCLK.It
  80. wouldalsobepossibletosupplyabaudrateclocktoRTxC,anda
  81. clockofadifferentfrequencytoPCLK(liketheprocessor
  82. clock).Thisoptionisselectedbyprefixingtheclockfrequency
  83. withan"r"insteadofa"p".
  84.  
  85. The"specialinterfacetype"and"interfaceparameter"fieldscan
  86. beusedtospecifysomespecialtypeofinterfaceboardtobe
  87. used.Thisrequiresmodificationtothedriversoftware.
  88. Currently,thefollowingspecialtypesaresupportedonthePC:
  89.  
  90. -type1:EAGLE
  91. -type2:PC-100
  92. -type4:PRIMUS
  93.      -type8:DRSIPC*Packet
  94.  
  95. ThePC-100andthePRIMUSacceptaninterfaceparameter,thatis
  96. usedtocontroltheon-boardMODEM.Itmustbespecifiedasa
  97. hexadecimalvaluetobesenttotheoutputportontheboard.
  98. ♪∙ÇPossibleinitialisationcommandsare:
  99.  
  100. EAGLE:attach scc 1 init 2e8 8 2 0 1 0 2 p36864001
  101.  
  102. PC-100:attach scc 1 init 2e816 6 4 1 0 2 p4915200222
  103.  
  104. PRIMUS:attach scc 1 init 2e8 4 2 0 1 0 2 r2457600402
  105.  
  106. DRSI:attach scc 1 init 300 16 2 0 1 0 2 p49152008
  107.  
  108. WhenusinganAT-typemachine(withtwo8259interrupt
  109. controllers),andusingthe"interrupt2"lineontheBUS,
  110. specifyinterruptnumber9insteadof2.Thisbetterreflects
  111. theactualconfiguration.TheBIOSwillattempttheredirection
  112. ofinterruptvector#9to#2,butitdoesnotcompletelydothe
  113. job.
  114.  
  115.  
  116. TheSCCdriverusesthe"buffers"featurethatpre-allocatesa
  117. numberofreceiverbufferstobeusedbythedriversatinterrupt
  118. time.Besuretoissuea"buffers<n>"commandbeforeyouattach
  119. anyoftheSCC'schannels(seebelow).The<n>parameterofthe
  120. bufferscommandspecifiesthenumberofbufferstopre-allocate,
  121. thisisafunctionofthenumberofchannelsyouwillattach,the
  122. baudrateofthechannels,theactivityoneachofthesechannels,
  123. andthetimethecomputercanspendwithoutre-allocatingnew
  124. buffers.Agoodnumberofreceiverbufferstotryis32.Ifyou
  125. seeanon-zeronumberinthe"Space"columnintheSCCSTAToutput
  126. (seebelow)youcanincreasethisnumber.Itspecifiesthe
  127. numberof128-bytebuffersthatarepre-allocatedforthe
  128. receiverbuffersofallchannelsattached.Sointhiscase,
  129. 4Kbytesareallocated.
  130. Itisalsopossibletosetthesizeofthebufferstobe
  131. allocated,usingthe2ndand3rdargumentofthe"buffers"
  132. command.Thesesetaminimalandmaximalsizeofeachbuffer.
  133. ThePCversionwillonlyallocatebuffersofthemaximumsize
  134. (andignoresthesecondargument),buttheAtariSTversions
  135. minimizesthethrashingofthememoryfreelistbyallocating
  136. buffersbetweentheminimalandmaximalsize,thatcanbecarved
  137. outofthefreelistwithoutfurthersplittingblocksofmemory.
  138. Example:buffers6410128
  139.  
  140. ê2.AttachcommandsÇ
  141.  
  142. WhentheSCCdriverhasbeeninitialized,youcanattachthe
  143. channels.Thisisdoneusingoneof3formsofthe"attachscc"
  144. command:
  145.  
  146. attachscc<channel>slip<mtu><baudrate>
  147.      attachscc<channel>kiss<mtu><baudrate><callsign>
  148.      attachscc<channel>ax25<mtu><baudrate><callsign>
  149.  
  150. Thesewillberefferredtoas"slip","kiss"and"ax25"mode.
  151.  
  152. ÇThe<channel>parameterspecifieswhichhalfofwhichSCCwillbe
  153. programmed,asfollows:
  154.  
  155. channel0:"A"sideoffirstSCC
  156. channel1:"B"sideoffirstSCC
  157.      channel2:"A"sideofsecondSCC
  158.      channel3:"B"sideofsecondSCC
  159.  
  160. etcetera.Thechannelnumberrangesfrom0to(2*nchips)-1,
  161. wherenchipsisthenumberofchipsspecifiedinthe
  162. "attachsccinit"command.
  163.  
  164.  
  165. ♪⑥êSLIPmodeÇ
  166.  
  167. Thiscanbeusedforalinktoanothermachine,whenthechannel
  168. hasanRS232interface.Example:
  169.  
  170. attachscc0slipsl02569600
  171.  
  172. ♪⑤Thisattachesthe"A"sideofthefirstSCCasinterface"sl0",
  173. withanMTUof256andaninitialbaudrateof9600.Thebaudrate
  174. canbechangedlaterby:
  175.  
  176. paramsl0<baudrate>
  177.  
  178. Enteringjust"paramsl0"willdisplaythecurrentbaudrate.
  179.  
  180. êKISSmodeÇ
  181.  
  182. KISSmodecanbeusedtotalktoaKISSTNC.Itcanalsobeused
  183. onanasynchronouslinktoanothercomputerrunningNET.
  184. ThedifferencewithSLIPisthattheinterfacewillbeAX.25
  185. type,andcanthereforebeusedforAX.25connections.A
  186. callsignmustbegivenasaparameter,thiswillbeusedforIP
  187. andNET/ROMpurposesontheinterface.Example:
  188.  
  189. attach scc 2 kiss 430 256 4800 pe1chl-7
  190.  
  191. Intheexamplethe"A"sideofthesecondSCCwillbeattachedas
  192. interface"430"usinganMTUof256,abaudrateof4800andthe
  193. callsignPE1CHL-7.
  194.  
  195. Thecommand"param430<paramnum><decimalvalue>"canbeusedto
  196. settheparametersoftheKISSTNC.Itisnotpossibleto
  197. displaythecurrentsettings.
  198.  
  199.  
  200. êAX.25modeÇ
  201.  
  202. Thisisprobablythemostintere